package com.xyz.eduservice.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xyz.eduservice.entity.EduCourse;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xyz.eduservice.entity.frontvo.CourseFrontInfoVo;
import com.xyz.eduservice.entity.frontvo.CourseFrontQuery;
import com.xyz.eduservice.entity.query.CourseQuery;
import com.xyz.eduservice.entity.vo.CourseInfoVo;
import com.xyz.eduservice.entity.vo.CoursePublishVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课程 服务类
 * </p>
 *
 * @author zsr
 * @since 2021-06-11
 */
public interface EduCourseService extends IService<EduCourse> {

    String saveCourseInfo(CourseInfoVo courseInfoVo);

    CourseInfoVo getCourseInfoById(String courseId);

    void updateCourseInfoById(CourseInfoVo courseInfoVo);

    CoursePublishVo getCoursePublishVoById(String id);

    boolean publishCourseById(String id);

    void pageQuery(Page<EduCourse> pageParam, CourseQuery courseQuery);

    boolean removeCourseById(String courseId);

    /**
     * 根据教师id查询课程
     * @param id
     * @return
     */
    List<EduCourse> selectByTeacherId(String id);

    /**
     * 获取前台课程分页列表
     * @param pageParam
     * @param courseQuery
     * @return
     */
    Map<String, Object> getCourseFrontList(Page<EduCourse> pageParam, CourseFrontQuery courseQuery);


    /**
     * 获取前台课程信息
     * @param courseId 课程id
     * @return
     */
    CourseFrontInfoVo selectInfoWebById(String courseId);

    /**
     * 更新课程浏览数
     * @param id 课程id
     */
    void updatePageViewCount(String id);
}
